package com.changcheng.project.yuminsi.controller;


import com.changcheng.framework.aspectj.LogPointcut;
import com.changcheng.project.yuminsi.service.ApplyService;
import com.changcheng.project.yuminsi.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author yuminsi
 * @description
 * @date 2020/8/19 18:20
 * @since
 */
@Api(description = "ETC通用接口")
@RestController
@RequestMapping("/v1.0/etc")
public class ApplyController {

    @Autowired
    private ApplyService applyService;


    @ApiOperation(value = "获取ETC账户信息", notes = "获取ETC账户信息")
    @LogPointcut(description = "获取ETC账户信息")
    @GetMapping("/etcServiceForDataQuery/getEtcAccountInfo")
    public BaseOutput getEtcStatus(@RequestParam("vin") String vin,
                                                      @RequestParam("plateNo") String plateNo,
                                                      @RequestParam("phone") String phone) throws Exception {
        return applyService.getEtcStatus(vin,plateNo,phone);
    }


    @ApiOperation(value = "设备认证接口", notes = "设备认证接口")
//    @LogPointcut(description = "设备认证接口")
    @PostMapping("/apply/deviceAuth")
    public BaseOutput deviceAuth(@RequestBody DeviceAuthRequest deviceAuthRequest) throws Exception {
        return applyService.deviceAuth(deviceAuthRequest);
    }


    @ApiOperation(value = "用户注册接口",notes = "用户注册接口")
//    @LogPointcut(description = "用户注册接口")
    @PostMapping("/apply/orderRegister")
    public BaseOutput orderRegister(@RequestBody UniversalRequest universalRequest) throws Exception {
        return applyService.orderRegister(universalRequest);
    }


    @ApiOperation(value = "车辆验证接口",notes = "车辆验证接口")
//    @LogPointcut(description = "车辆验证接口")
    @PostMapping("/apply/vehicleVerify")
    public BaseOutput vehiVerify(@RequestBody UniversalRequest universalRequest) throws Exception {
        return applyService.vehiVerify(universalRequest);
    }


    @ApiOperation(value = "车辆信息采集接口",notes = "车辆信息采集接口")
//    @LogPointcut(description = "车辆信息采集接口")
    @PostMapping("/apply/vehicleInfoCollect")
    public BaseOutput vehiInfoCollect(@RequestBody UniversalRequest universalRequest) throws Exception {
        return applyService.vehiInfoCollect(universalRequest);
    }


    @ApiOperation(value = "卡二发申请", notes = "卡二发申请")
//    @LogPointcut(description = "卡二发申请")
    @PostMapping("/apply/cardIssueApply")
    public BaseOutput cardIssueApply(@RequestBody CardIssueRequest cardIssueRequest) throws Exception {
        return applyService.cardIssueApply(cardIssueRequest);
    }


    @ApiOperation(value = "卡二发结果确认", notes = "卡二发结果确认")
//    @LogPointcut(description = "卡二发结果确认")
    @PostMapping("/apply/cardIssueConfirm")
    public BaseOutput cardIssueConfirm(@RequestBody IssueConfirmRequest issueConfirmRequest) throws Exception {
        return applyService.cardIssueConfirm(issueConfirmRequest);
    }


    @ApiOperation(value = "OBU二发写系统信息", notes = "OBU二发写系统信息")
//    @LogPointcut(description = "OBU二发写系统信息")
    @PostMapping("/apply/obuIssueApply")
    public BaseOutput obuIssueApply(@RequestBody IssueSysRequest issueSysRequest) throws Exception {
        return applyService.obuIssueSys(issueSysRequest);
    }


    @ApiOperation(value = "OBU二发写车辆信息", notes = "OBU二发写车辆信息")
//    @LogPointcut(description = "OBU二发写车辆信息")
    @PostMapping("/apply/obuIssueDate")
    public BaseOutput obuIssueDate(@RequestBody IssueVehiRequest issueVehiRequest) throws Exception {
        return applyService.obuIssueVehi(issueVehiRequest);
    }

    @ApiOperation(value = "OBU二发通知", notes = "OBU二发通知")
//    @LogPointcut(description = "OBU二发通知")
    @PostMapping("/apply/obuIssueNotice")
    public BaseOutput obuIssueNotice(@RequestBody IssueNoticeRequest issueNoticeRequest) throws Exception {
        return applyService.obuIssueNotice(issueNoticeRequest);
    }

    @ApiOperation(value = "OBU激活接口", notes = "OBU激活接口")
//    @LogPointcut(description = "OBU激活接口")
    @PostMapping("/apply/obuActivate")
    public BaseOutput obuActivate(@RequestBody ActivateRequest activateRequest) throws Exception {
        return applyService.obuActivate(activateRequest);
    }

    @ApiOperation(value = "OBU激活接通知接口", notes = "OBU激活接通知接口")
//    @LogPointcut(description = "OBU激活接通知接口")
    @PostMapping("/apply/obuActivateNotice")
    public BaseOutput obuActivateNotice(@RequestBody ActivateNoticeRequest activateNoticeRequest) throws Exception {
        return applyService.obuActivateNotice(activateNoticeRequest);
    }



}
